import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
// import { AaaInterceptor } from './aaa.interceptor';
import { ValidationPipe } from '@nestjs/common';
import { NestExpressApplication } from '@nestjs/platform-express';

async function bootstrap() {
  const app = await NestFactory.create<NestExpressApplication>(AppModule, {
    cors: true,
  });
  // app.useStaticAssets('public', {
  //   prefix: 'static',
  // });
  // app.useLogger(new MyLogger());
  // app.useGlobalInterceptors(new AaaInterceptor());
  app.useGlobalPipes(
    new ValidationPipe({
      // skipUndefinedProperties: true,
      stopAtFirstError: true,
      transform: true,
      transformOptions: {
        enableImplicitConversion: true,
      },
    }),
  );

  await app.listen(3000);
}
bootstrap();
